/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('chatbot', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model Children {
  areaCode?: string(name='AreaCode'),
  categoryId?: long(name='CategoryId'),
  childrens?: [
    Children
  ](name='Childrens'),
  name?: string(name='Name'),
  parentCategoryId?: long(name='ParentCategoryId'),
}

model IntentCreateDTO {
  intentId?: long(name='IntentId'),
  name?: string(name='Name'),
  ruleCheck?: [
    RuleMtopDTO
  ](name='RuleCheck'),
  slot?: [
    SlotrecordMtopDTO
  ](name='Slot'),
  userSay?: [
    UsersayMtopDTO
  ](name='UserSay'),
}

model PaasButtonDTO {
  name?: string(name='Name'),
  text?: string(name='Text'),
  type?: string(name='Type'),
}

model PaasButtonListDTO {
  button?: [
    PaasButtonDTO
  ](name='Button'),
  intro?: string(name='Intro'),
}

model PaasConditionEntryDTO {
  id?: string(name='Id'),
  name?: string(name='Name'),
  term?: string(name='Term'),
  type?: string(name='Type'),
  value?: string(name='Value'),
}

model PaasConditionSetDTO {
  conditionEntries?: [
    PaasConditionEntryDTO
  ](name='ConditionEntries'),
}

model PaasEdgeDTO {
  id?: string(name='Id'),
  label?: string(name='Label'),
  source?: string(name='Source'),
  target?: string(name='Target'),
}

model PaasEntryDTO {
  pluginFieldDataEntry?: PaasEntryPluginFieldDataDTO(name='PluginFieldDataEntry'),
}

model PaasEntryPluginFieldDataDTO {
  contentEntry?: [
    PaasConditionSetDTO
  ](name='ContentEntry'),
  lifeSpan?: long(name='LifeSpan'),
  name?: string(name='Name'),
}

model PaasFunctionDTO {
  pluginFieldDataFunction?: PaasFunctionPluginFieldDataDTO(name='PluginFieldDataFunction'),
}

model PaasFunctionPluginFieldDataDTO {
  aliyunFunction?: string(name='AliyunFunction'),
  aliyunService?: string(name='AliyunService'),
  code?: string(name='Code'),
  description?: string(name='Description'),
  endPoint?: string(name='EndPoint'),
  function?: string(name='Function'),
  name?: string(name='Name'),
  params?: map[string]any(name='Params'),
  switch?: [
    PaasSwitchCaseDTO
  ](name='Switch'),
  type?: string(name='Type'),
}

model PaasFunctionPluginParams {
  body?: string(name='Body'),
  header?: map[string]string(name='Header'),
  method?: string(name='Method'),
  query?: map[string]string(name='Query'),
  url?: string(name='Url'),
}

model PaasNodeDTO {
  code?: string(name='Code'),
  id?: string(name='Id'),
  label?: string(name='Label'),
  pluginData?: PaasPluginDataDTO(name='PluginData'),
  xx?: double(name='Xx'),
  yy?: double(name='Yy'),
}

model PaasPluginDataDTO {
  entry?: PaasEntryDTO(name='Entry'),
  function?: PaasFunctionDTO(name='Function'),
  response?: PaasResponseDTO(name='Response'),
  slot?: PaasSlotDTO(name='Slot'),
}

model PaasProcessData {
  edges?: [
    PaasEdgeDTO
  ](name='Edges'),
  nodes?: [
    PaasNodeDTO
  ](name='Nodes'),
}

model PaasResponseDTO {
  pluginFieldDataResponse?: PaasResponsePluginFieldDataDTO(name='PluginFieldDataResponse'),
}

model PaasResponseNodeContentDTO {
  buttonList?: PaasButtonListDTO(name='ButtonList'),
  image?: string(name='Image'),
  text?: string(name='Text'),
  type?: string(name='Type'),
}

model PaasResponsePluginFieldDataDTO {
  contentResponse?: PaasResponseNodeContentDTO(name='ContentResponse'),
  name?: string(name='Name'),
}

model PaasSlotConfigDTO {
  isArray?: boolean(name='IsArray'),
  isNecessary?: boolean(name='IsNecessary'),
  lifeSpan?: int32(name='LifeSpan'),
  name?: string(name='Name'),
  question?: [ string ](name='Question'),
  value?: string(name='Value'),
}

model PaasSlotDTO {
  pluginFieldDataSlot?: PaasSlotPluginFieldDataDTO(name='PluginFieldDataSlot'),
}

model PaasSlotPluginFieldDataDTO {
  contentSlot?: [
    PaasSlotConfigDTO
  ](name='ContentSlot'),
  intentId?: string(name='IntentId'),
  intentName?: string(name='IntentName'),
  isSysIntent?: boolean(name='IsSysIntent'),
  name?: string(name='Name'),
}

model PaasSwitchCaseDTO {
  id?: string(name='Id'),
  label?: string(name='Label'),
  type?: string(name='Type'),
  value?: string(name='Value'),
  variableName?: string(name='VariableName'),
}

model RuleMtopDTO {
  error?: [ string ](name='Error'),
  strict?: boolean(name='Strict'),
  text?: string(name='Text'),
  warning?: [ string ](name='Warning'),
}

model SectionMtopDTO {
  slotId?: string(name='SlotId'),
  text?: string(name='Text'),
}

model SlotrecordMtopDTO {
  id?: string(name='Id'),
  isArray?: boolean(name='IsArray'),
  isNecessary?: boolean(name='IsNecessary'),
  lifeSpan?: int32(name='LifeSpan'),
  name?: string(name='Name'),
  question?: [ string ](name='Question'),
  tags?: [
    TagMtopDTO
  ](name='Tags'),
  value?: string(name='Value'),
}

model TagMtopDTO {
  userSayId?: string(name='UserSayId'),
  value?: string(name='Value'),
}

model UpdateDialogFlowModuleDefinition {
  edges?: [
    PaasEdgeDTO
  ](name='Edges'),
  nodes?: [
    PaasNodeDTO
  ](name='Nodes'),
}

model UsersayMtopDTO {
  data?: [
    SectionMtopDTO
  ](name='Data'),
  id?: string(name='Id'),
  strict?: boolean(name='Strict'),
}

model ActivatePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  perspectiveId?: string(name='PerspectiveId', example='7487'),
}

model ActivatePerspectiveResponseBody = {
  requestId?: string(name='RequestId', example='9C5F8186-2D22-433E-9545-606D344F30B5'),
}

model ActivatePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ActivatePerspectiveResponseBody(name='body'),
}

async function activatePerspectiveWithOptions(request: ActivatePerspectiveRequest, runtime: Util.RuntimeOptions): ActivatePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.perspectiveId)) {
    query['PerspectiveId'] = request.perspectiveId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ActivatePerspective',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function activatePerspective(request: ActivatePerspectiveRequest): ActivatePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return activatePerspectiveWithOptions(request, runtime);
}

model AddSynonymRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  coreWordName?: string(name='CoreWordName'),
  synonym?: string(name='Synonym'),
}

model AddSynonymResponseBody = {
  requestId?: string(name='RequestId', example='47D26156-D4C3-4E48-B0D6-25BBF7A3BC1D'),
}

model AddSynonymResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddSynonymResponseBody(name='body'),
}

async function addSynonymWithOptions(request: AddSynonymRequest, runtime: Util.RuntimeOptions): AddSynonymResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  if (!Util.isUnset(request.synonym)) {
    query['Synonym'] = request.synonym;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddSynonym',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addSynonym(request: AddSynonymRequest): AddSynonymResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSynonymWithOptions(request, runtime);
}

model AppendEntityMemberRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  applyType?: string(name='ApplyType', example='memberName'),
  entityId?: long(name='EntityId', example='62899'),
  member?: {
    memberName?: string(name='MemberName'),
    synonyms?: [ string ](name='Synonyms'),
  }(name='Member'),
}

model AppendEntityMemberShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  applyType?: string(name='ApplyType', example='memberName'),
  entityId?: long(name='EntityId', example='62899'),
  memberShrink?: string(name='Member'),
}

model AppendEntityMemberResponseBody = {
  entityId?: long(name='EntityId', example='13853'),
  requestId?: string(name='RequestId', example='07B270A4-61D8-57F6-A609-A3C216CFB872'),
}

model AppendEntityMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AppendEntityMemberResponseBody(name='body'),
}

async function appendEntityMemberWithOptions(tmpReq: AppendEntityMemberRequest, runtime: Util.RuntimeOptions): AppendEntityMemberResponse {
  Util.validateModel(tmpReq);
  var request = new AppendEntityMemberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.member)) {
    request.memberShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.member, 'Member', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.applyType)) {
    query['ApplyType'] = request.applyType;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.memberShrink)) {
    query['Member'] = request.memberShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AppendEntityMember',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function appendEntityMember(request: AppendEntityMemberRequest): AppendEntityMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return appendEntityMemberWithOptions(request, runtime);
}

model AssociateRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-eEf'),
  perspective?: [ string ](name='Perspective'),
  recommendNum?: int32(name='RecommendNum', example='1'),
  sessionId?: string(name='SessionId', example='25670484f2ab4b42ba90acbfbf86d4cd'),
  utterance?: string(name='Utterance'),
}

model AssociateResponseBody = {
  associate?: [ 
    {
      title?: string(name='Title'),
    }
  ](name='Associate'),
  messageId?: string(name='MessageId', example='11bab7a2e34c4e02bcf0ebcb76bb812d'),
  requestId?: string(name='RequestId', example='402FCD5F-518E-4C8E-8A6B-EFEADA69D757'),
  sessionId?: string(name='SessionId', example='25670484f2ab4b42ba90acbfbf86d4cd'),
}

model AssociateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateResponseBody(name='body'),
}

async function associateWithOptions(request: AssociateRequest, runtime: Util.RuntimeOptions): AssociateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.perspective)) {
    query['Perspective'] = request.perspective;
  }
  if (!Util.isUnset(request.recommendNum)) {
    query['RecommendNum'] = request.recommendNum;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.utterance)) {
    query['Utterance'] = request.utterance;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Associate',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associate(request: AssociateRequest): AssociateResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateWithOptions(request, runtime);
}

model ChatRequest {
  agentKey?: string(name='AgentKey', example='d4f70cf7cc5e4a3ba6c82c8ae1e1d99d_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqMQe'),
  intentName?: string(name='IntentName', example='TIMEOUT'),
  knowledgeId?: string(name='KnowledgeId', example='1002994742'),
  perspective?: [ string ](name='Perspective'),
  senderId?: string(name='SenderId', example='83325'),
  senderNick?: string(name='SenderNick'),
  sessionId?: string(name='SessionId', example='2e00330f2a7e47cd8ca56d12ed51c62d'),
  tag?: string(name='Tag', example='{\\"bizId\\":\\"110000100098985\\",\\"bizType\\":\\"ITEM\\"}'),
  utterance?: string(name='Utterance'),
  vendorParam?: string(name='VendorParam', example='{\\"requestId\\":\\"7DD7849A-0117-5BD8-A411-994FDE07CFBC\\",\\"conversationId\\":\\"1637460236.155930\\"}'),
}

model ChatResponseBody = {
  messageId?: string(name='MessageId', example='396E74B3-D84B-46CE-9E51-91C06AD22E31'),
  messages?: [ 
    {
      answerSource?: string(name='AnswerSource', example='BotFramework'),
      answerType?: string(name='AnswerType', example='Text'),
      knowledge?: {
        answerSource?: string(name='AnswerSource', example='KnowledgeBase'),
        category?: string(name='Category'),
        content?: string(name='Content'),
        contentType?: string(name='ContentType', example='PLAIN_TEXT'),
        hitStatement?: string(name='HitStatement'),
        id?: string(name='Id', example='834322'),
        relatedKnowledges?: [ 
          {
            knowledgeId?: string(name='KnowledgeId', example='82318'),
            title?: string(name='Title'),
          }
        ](name='RelatedKnowledges'),
        score?: double(name='Score', example='0.998'),
        summary?: string(name='Summary'),
        title?: string(name='Title'),
      }(name='Knowledge'),
      recommends?: [ 
        {
          answerSource?: string(name='AnswerSource', example='KNOWLEDGE'),
          knowledgeId?: string(name='KnowledgeId', example='11111'),
          score?: double(name='Score', example='0.88'),
          title?: string(name='Title'),
        }
      ](name='Recommends'),
      text?: {
        answerSource?: string(name='AnswerSource'),
        articleTitle?: string(name='ArticleTitle'),
        commands?: map[string]any(name='Commands'),
        content?: string(name='Content'),
        contentType?: string(name='ContentType', example='RICH_TEXT'),
        dialogName?: string(name='DialogName'),
        ext?: map[string]any(name='Ext'),
        externalFlags?: map[string]any(name='ExternalFlags'),
        hitStatement?: string(name='HitStatement'),
        intentName?: string(name='IntentName'),
        metaData?: string(name='MetaData', example='{}'),
        nodeId?: string(name='NodeId', example='1410-c7a72a78.__city'),
        nodeName?: string(name='NodeName'),
        score?: double(name='Score', example='0.988'),
        slots?: [ 
          {
            isHit?: boolean(name='IsHit', example='true'),
            name?: string(name='Name'),
            origin?: string(name='Origin'),
            value?: string(name='Value'),
          }
        ](name='Slots'),
        userDefinedChatTitle?: string(name='UserDefinedChatTitle'),
      }(name='Text'),
      title?: string(name='Title'),
      type?: string(name='Type'),
      voiceStrategy?: {
        asrMaxEndSilence?: string(name='AsrMaxEndSilence'),
        collectNumber?: boolean(name='CollectNumber'),
        hangUp?: boolean(name='HangUp'),
        interruptible?: boolean(name='Interruptible'),
        maxDigits?: long(name='MaxDigits'),
        replyTimeout?: long(name='ReplyTimeout'),
        terminator?: string(name='Terminator'),
      }(name='VoiceStrategy'),
      voiceTitle?: string(name='VoiceTitle'),
    }
  ](name='Messages'),
  requestId?: string(name='RequestId', example='A2315C4B-A872-5DEE-9DAD-D73B194A4AEC'),
  sessionId?: string(name='SessionId', example='2e00330f2a7e47cd8ca56d12ed51c62d'),
  tag?: string(name='Tag', example='{\\"bizId\\":\\"110000100098985\\",\\"bizType\\":\\"ITEM\\"}'),
}

model ChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChatResponseBody(name='body'),
}

async function chatWithOptions(request: ChatRequest, runtime: Util.RuntimeOptions): ChatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentName)) {
    query['IntentName'] = request.intentName;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  if (!Util.isUnset(request.perspective)) {
    query['Perspective'] = request.perspective;
  }
  if (!Util.isUnset(request.senderId)) {
    query['SenderId'] = request.senderId;
  }
  if (!Util.isUnset(request.senderNick)) {
    query['SenderNick'] = request.senderNick;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.utterance)) {
    query['Utterance'] = request.utterance;
  }
  if (!Util.isUnset(request.vendorParam)) {
    query['VendorParam'] = request.vendorParam;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Chat',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function chat(request: ChatRequest): ChatResponse {
  var runtime = new Util.RuntimeOptions{};
  return chatWithOptions(request, runtime);
}

model CreateBotRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  avatar?: string(name='Avatar', example='http://test.oss-cn-beijing.aliyuncs.com/test.jpg'),
  introduction?: string(name='Introduction'),
  languageCode?: string(name='LanguageCode', example='zh-cn'),
  name?: string(name='Name', example='test'),
  robotType?: string(name='RobotType', example='scenario_im'),
}

model CreateBotResponseBody = {
  instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqM'),
  requestId?: string(name='RequestId', example='CDFB7CDF-CCBF-4388-AC7D-9484DB457FFF'),
}

model CreateBotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBotResponseBody(name='body'),
}

async function createBotWithOptions(request: CreateBotRequest, runtime: Util.RuntimeOptions): CreateBotResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.avatar)) {
    query['Avatar'] = request.avatar;
  }
  if (!Util.isUnset(request.introduction)) {
    query['Introduction'] = request.introduction;
  }
  if (!Util.isUnset(request.languageCode)) {
    query['LanguageCode'] = request.languageCode;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.robotType)) {
    query['RobotType'] = request.robotType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBot',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createBot(request: CreateBotRequest): CreateBotResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBotWithOptions(request, runtime);
}

model CreateCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  name?: string(name='Name'),
  parentCategoryId?: long(name='ParentCategoryId', example='-1'),
}

model CreateCategoryResponseBody = {
  categoryId?: long(name='CategoryId', example='2100073759'),
  requestId?: string(name='RequestId', example='17204B98-7734-4F9A-8464-2446A84821CA'),
  success?: boolean(name='Success', example='true'),
}

model CreateCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCategoryResponseBody(name='body'),
}

async function createCategoryWithOptions(request: CreateCategoryRequest, runtime: Util.RuntimeOptions): CreateCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.parentCategoryId)) {
    query['ParentCategoryId'] = request.parentCategoryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCategory',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCategory(request: CreateCategoryRequest): CreateCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCategoryWithOptions(request, runtime);
}

model CreateCoreWordRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  coreWordName?: string(name='CoreWordName'),
}

model CreateCoreWordResponseBody = {
  coreWordCode?: string(name='CoreWordCode', example='ceb9d68c-dbb5-32c9-a02c-eca56b782ff7'),
  requestId?: string(name='RequestId', example='E3E5C779-A630-45AC-B0F2-A4506A4212F1'),
}

model CreateCoreWordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCoreWordResponseBody(name='body'),
}

async function createCoreWordWithOptions(request: CreateCoreWordRequest, runtime: Util.RuntimeOptions): CreateCoreWordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCoreWord',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCoreWord(request: CreateCoreWordRequest): CreateCoreWordResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCoreWordWithOptions(request, runtime);
}

model CreateDialogRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  description?: string(name='Description'),
  dialogName?: string(name='DialogName'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqMQe'),
}

model CreateDialogResponseBody = {
  dialogId?: long(name='DialogId', example='50120'),
  requestId?: string(name='RequestId', example='16AC1B3C-66E0-438B-BB7C-71B692407B67'),
}

model CreateDialogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDialogResponseBody(name='body'),
}

async function createDialogWithOptions(request: CreateDialogRequest, runtime: Util.RuntimeOptions): CreateDialogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dialogName)) {
    query['DialogName'] = request.dialogName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDialog',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDialog(request: CreateDialogRequest): CreateDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDialogWithOptions(request, runtime);
}

model CreateEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='103610'),
  entityName?: string(name='EntityName'),
  entityType?: string(name='EntityType', example='synonyms'),
  members?: [ 
    {
      memberName?: string(name='MemberName'),
      synonyms?: [ string ](name='Synonyms'),
    }
  ](name='Members'),
  regex?: string(name='Regex', example='\\d{5,8}'),
}

model CreateEntityShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='103610'),
  entityName?: string(name='EntityName'),
  entityType?: string(name='EntityType', example='synonyms'),
  membersShrink?: string(name='Members'),
  regex?: string(name='Regex', example='\\d{5,8}'),
}

model CreateEntityResponseBody = {
  entityId?: long(name='EntityId', example='72121'),
  requestId?: string(name='RequestId', example='28805A7C-D695-548C-A31B-67E52C2C274F'),
}

model CreateEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEntityResponseBody(name='body'),
}

async function createEntityWithOptions(tmpReq: CreateEntityRequest, runtime: Util.RuntimeOptions): CreateEntityResponse {
  Util.validateModel(tmpReq);
  var request = new CreateEntityShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.members)) {
    request.membersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.members, 'Members', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  if (!Util.isUnset(request.entityName)) {
    query['EntityName'] = request.entityName;
  }
  if (!Util.isUnset(request.entityType)) {
    query['EntityType'] = request.entityType;
  }
  if (!Util.isUnset(request.membersShrink)) {
    query['Members'] = request.membersShrink;
  }
  if (!Util.isUnset(request.regex)) {
    query['Regex'] = request.regex;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateEntity',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createEntity(request: CreateEntityRequest): CreateEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return createEntityWithOptions(request, runtime);
}

model CreateIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='50099'),
  intentDefinition?: IntentCreateDTO(name='IntentDefinition'),
}

model CreateIntentShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='50099'),
  intentDefinitionShrink?: string(name='IntentDefinition'),
}

model CreateIntentResponseBody = {
  intentId?: long(name='IntentId', example='58985'),
  requestId?: string(name='RequestId', example='8AD9FA10-7780-5E12-B701-13C928524F32'),
}

model CreateIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIntentResponseBody(name='body'),
}

async function createIntentWithOptions(tmpReq: CreateIntentRequest, runtime: Util.RuntimeOptions): CreateIntentResponse {
  Util.validateModel(tmpReq);
  var request = new CreateIntentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.intentDefinition)) {
    request.intentDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.intentDefinition, 'IntentDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  if (!Util.isUnset(request.intentDefinitionShrink)) {
    query['IntentDefinition'] = request.intentDefinitionShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIntent',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIntent(request: CreateIntentRequest): CreateIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIntentWithOptions(request, runtime);
}

model CreateKnowledgeRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledge?: {
    categoryId?: long(name='CategoryId', example='30000049006'),
    endDate?: string(name='EndDate', example='2099-12-31T16:00:00Z'),
    knowledgeTitle?: string(name='KnowledgeTitle'),
    knowledgeType?: int32(name='KnowledgeType', example='1'),
    outlines?: [ 
      {
        knowledgeId?: long(name='KnowledgeId', example='30001905617'),
        outlineId?: long(name='OutlineId', example='30001979424'),
        title?: string(name='Title'),
      }
    ](name='Outlines'),
    simQuestions?: [ 
      {
        title?: string(name='Title'),
      }
    ](name='SimQuestions'),
    solutions?: [ 
      {
        content?: string(name='Content'),
        perspectiveIds?: [ string ](name='PerspectiveIds'),
        plainText?: string(name='PlainText'),
      }
    ](name='Solutions'),
    startDate?: string(name='StartDate', example='1979-12-31T16:00:00Z'),
  }(name='Knowledge'),
}

model CreateKnowledgeShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeShrink?: string(name='Knowledge'),
}

model CreateKnowledgeResponseBody = {
  knowledgeId?: long(name='KnowledgeId', example='30001905617'),
  requestId?: string(name='RequestId', example='8334b404-3124-47a4-92df-5c7648158b6f'),
}

model CreateKnowledgeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateKnowledgeResponseBody(name='body'),
}

async function createKnowledgeWithOptions(tmpReq: CreateKnowledgeRequest, runtime: Util.RuntimeOptions): CreateKnowledgeResponse {
  Util.validateModel(tmpReq);
  var request = new CreateKnowledgeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.knowledge)) {
    request.knowledgeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.knowledge, 'Knowledge', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeShrink)) {
    body['Knowledge'] = request.knowledgeShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateKnowledge',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createKnowledge(request: CreateKnowledgeRequest): CreateKnowledgeResponse {
  var runtime = new Util.RuntimeOptions{};
  return createKnowledgeWithOptions(request, runtime);
}

model CreatePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  name?: string(name='Name'),
}

model CreatePerspectiveResponseBody = {
  perspectiveId?: string(name='PerspectiveId', example='7488'),
  requestId?: string(name='RequestId', example='F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A'),
}

model CreatePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePerspectiveResponseBody(name='body'),
}

async function createPerspectiveWithOptions(request: CreatePerspectiveRequest, runtime: Util.RuntimeOptions): CreatePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePerspective',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createPerspective(request: CreatePerspectiveRequest): CreatePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPerspectiveWithOptions(request, runtime);
}

model DeleteBotRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-xxxxxxx'),
}

model DeleteBotResponseBody = {
  requestId?: string(name='RequestId', example='F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A'),
}

model DeleteBotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBotResponseBody(name='body'),
}

async function deleteBotWithOptions(request: DeleteBotRequest, runtime: Util.RuntimeOptions): DeleteBotResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBot',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteBot(request: DeleteBotRequest): DeleteBotResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBotWithOptions(request, runtime);
}

model DeleteCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', example='30000049006'),
}

model DeleteCategoryResponseBody = {
  requestId?: string(name='RequestId', example='4B3E0DE3-DC57-5BFE-88D4-ADD8ED024F55'),
  success?: boolean(name='Success', example='true'),
}

model DeleteCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCategoryResponseBody(name='body'),
}

async function deleteCategoryWithOptions(request: DeleteCategoryRequest, runtime: Util.RuntimeOptions): DeleteCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCategory',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteCategory(request: DeleteCategoryRequest): DeleteCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCategoryWithOptions(request, runtime);
}

model DeleteCoreWordRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  coreWordName?: string(name='CoreWordName'),
}

model DeleteCoreWordResponseBody = {
  requestId?: string(name='RequestId', example='E45491D5-7E0A-42C6-9B21-91D1066B1475'),
  success?: boolean(name='Success', example='true'),
}

model DeleteCoreWordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCoreWordResponseBody(name='body'),
}

async function deleteCoreWordWithOptions(request: DeleteCoreWordRequest, runtime: Util.RuntimeOptions): DeleteCoreWordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCoreWord',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteCoreWord(request: DeleteCoreWordRequest): DeleteCoreWordResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCoreWordWithOptions(request, runtime);
}

model DeleteDialogRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='50127'),
}

model DeleteDialogResponseBody = {
  requestId?: string(name='RequestId', example='C6C17866-D5BF-4B90-8224-FC38F069F4C0'),
}

model DeleteDialogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDialogResponseBody(name='body'),
}

async function deleteDialogWithOptions(request: DeleteDialogRequest, runtime: Util.RuntimeOptions): DeleteDialogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDialog',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDialog(request: DeleteDialogRequest): DeleteDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDialogWithOptions(request, runtime);
}

model DeleteEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', example='42212'),
}

model DeleteEntityResponseBody = {
  entityId?: long(name='EntityId', example='42212'),
  requestId?: string(name='RequestId', example='851BCF73-08DB-4738-AC23-302C591C1C86'),
}

model DeleteEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEntityResponseBody(name='body'),
}

async function deleteEntityWithOptions(request: DeleteEntityRequest, runtime: Util.RuntimeOptions): DeleteEntityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEntity',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEntity(request: DeleteEntityRequest): DeleteEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEntityWithOptions(request, runtime);
}

model DeleteIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  intentId?: long(name='IntentId', example='126558'),
}

model DeleteIntentResponseBody = {
  intentId?: long(name='IntentId', example='126558'),
  requestId?: string(name='RequestId', example='6658EB01-A68C-4041-93ED-CD3F9C887A19'),
}

model DeleteIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIntentResponseBody(name='body'),
}

async function deleteIntentWithOptions(request: DeleteIntentRequest, runtime: Util.RuntimeOptions): DeleteIntentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIntent',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteIntent(request: DeleteIntentRequest): DeleteIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIntentWithOptions(request, runtime);
}

model DeleteKnowledgeRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', example='30001979424'),
}

model DeleteKnowledgeResponseBody = {
  requestId?: string(name='RequestId', example='A629A28F-F25E-5572-A679-FA46FB0151D6'),
}

model DeleteKnowledgeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteKnowledgeResponseBody(name='body'),
}

async function deleteKnowledgeWithOptions(request: DeleteKnowledgeRequest, runtime: Util.RuntimeOptions): DeleteKnowledgeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteKnowledge',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteKnowledge(request: DeleteKnowledgeRequest): DeleteKnowledgeResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteKnowledgeWithOptions(request, runtime);
}

model DeletePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  perspectiveId?: string(name='PerspectiveId', example='3001'),
}

model DeletePerspectiveResponseBody = {
  requestId?: string(name='RequestId', example='FC384CE1-8D42-1900-84E1-F33F990F2B5E'),
  result?: boolean(name='Result', example='true'),
}

model DeletePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePerspectiveResponseBody(name='body'),
}

async function deletePerspectiveWithOptions(request: DeletePerspectiveRequest, runtime: Util.RuntimeOptions): DeletePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.perspectiveId)) {
    query['PerspectiveId'] = request.perspectiveId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePerspective',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePerspective(request: DeletePerspectiveRequest): DeletePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePerspectiveWithOptions(request, runtime);
}

model DescribeBotRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqM'),
}

model DescribeBotResponseBody = {
  avatar?: string(name='Avatar', example='http://test.oss-cn-beijing.aliyuncs.com/test.jpg'),
  categories?: [ 
    {
      categoryId?: long(name='CategoryId', example='2100073048'),
      name?: string(name='Name', example='test'),
      parentCategoryId?: long(name='ParentCategoryId', example='-1'),
    }
  ](name='Categories'),
  createTime?: string(name='CreateTime', example='2020-11-29T06:50:46Z'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqM'),
  introduction?: string(name='Introduction'),
  languageCode?: string(name='LanguageCode', example='zh-cn'),
  logo?: string(name='Logo'),
  name?: string(name='Name', example='test'),
  requestId?: string(name='RequestId', example='BF736BAB-5AC0-4092-82A9-85475D39D1'),
  timeZone?: string(name='TimeZone', example='Asia/Beijing'),
}

model DescribeBotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBotResponseBody(name='body'),
}

async function describeBotWithOptions(request: DescribeBotRequest, runtime: Util.RuntimeOptions): DescribeBotResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBot',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeBot(request: DescribeBotRequest): DescribeBotResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBotWithOptions(request, runtime);
}

model DescribeCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', example='30000049006'),
}

model DescribeCategoryResponseBody = {
  categoryId?: long(name='CategoryId', example='30000049006'),
  name?: string(name='Name'),
  parentCategoryId?: long(name='ParentCategoryId', example='-1'),
  requestId?: string(name='RequestId', example='2B0304FD-3804-5C06-9A83-77F5523664AF'),
}

model DescribeCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCategoryResponseBody(name='body'),
}

async function describeCategoryWithOptions(request: DescribeCategoryRequest, runtime: Util.RuntimeOptions): DescribeCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCategory',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeCategory(request: DescribeCategoryRequest): DescribeCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCategoryWithOptions(request, runtime);
}

model DescribeCoreWordRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  coreWordName?: string(name='CoreWordName'),
}

model DescribeCoreWordResponseBody = {
  coreWordCode?: string(name='CoreWordCode', example='5be359c7-c18b-353a-bfe5-659b229e272e'),
  coreWordName?: string(name='CoreWordName'),
  createTime?: string(name='CreateTime', example='2020-11-24T03:49:18Z'),
  modifyTime?: string(name='ModifyTime', example='2020-11-25T10:31:10Z'),
  requestId?: string(name='RequestId', example='F55D90C1-31BE-4B2A-AA3F-25EFC36F9419'),
  synonyms?: [ string ](name='Synonyms'),
}

model DescribeCoreWordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCoreWordResponseBody(name='body'),
}

async function describeCoreWordWithOptions(request: DescribeCoreWordRequest, runtime: Util.RuntimeOptions): DescribeCoreWordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCoreWord',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeCoreWord(request: DescribeCoreWordRequest): DescribeCoreWordResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCoreWordWithOptions(request, runtime);
}

model DescribeDialogRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='50099'),
}

model DescribeDialogResponseBody = {
  createTime?: string(name='CreateTime', example='2020-11-30T03:00:54Z'),
  createUserId?: string(name='CreateUserId', example='83225'),
  createUserName?: string(name='CreateUserName', example='null'),
  description?: string(name='Description'),
  dialogId?: long(name='DialogId', example='50099'),
  dialogName?: string(name='DialogName'),
  isOnline?: boolean(name='IsOnline', example='true'),
  isSampleDialog?: boolean(name='IsSampleDialog', example='false'),
  modifyTime?: string(name='ModifyTime', example='2020-11-30T06:05:11Z'),
  modifyUserId?: string(name='ModifyUserId', example='83225'),
  modifyUserName?: string(name='ModifyUserName', example='null'),
  requestId?: string(name='RequestId', example='F178F903-AFCF-4F1F-81A1-69A8D99B1D7E'),
  status?: int32(name='Status', example='6'),
}

model DescribeDialogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDialogResponseBody(name='body'),
}

async function describeDialogWithOptions(request: DescribeDialogRequest, runtime: Util.RuntimeOptions): DescribeDialogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDialog',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDialog(request: DescribeDialogRequest): DescribeDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDialogWithOptions(request, runtime);
}

model DescribeDialogFlowRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='49966'),
}

model DescribeDialogFlowResponseBody = {
  accountId?: string(name='AccountId', example='133208'),
  createTime?: string(name='CreateTime', example='1641953931'),
  createUserId?: string(name='CreateUserId', example='1760998'),
  createUserName?: string(name='CreateUserName', example='user001'),
  dialogId?: long(name='DialogId', example='49966'),
  dialogName?: string(name='DialogName'),
  globalVars?: map[string]any(name='GlobalVars', example='{"name": "", "age": ""}'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-Yvy7uEn7mb'),
  modifyTime?: string(name='ModifyTime', example='1641953931'),
  modifyUserId?: string(name='ModifyUserId', example='1760998'),
  modifyUserName?: string(name='ModifyUserName', example='user001'),
  moduleDefinition?: PaasProcessData(name='ModuleDefinition'),
  moduleId?: long(name='ModuleId', example='49162'),
  moduleName?: string(name='ModuleName'),
  requestId?: string(name='RequestId', example='6419BA93-D111-5225-8998-13E63E6D3940'),
  status?: int32(name='Status', description='0 for deleted, 1 for inSandbox, 2 for draft，3 for online', example='1'),
  tags?: string(name='Tags', description='null', example='default'),
  templates?: string(name='Templates'),
}

model DescribeDialogFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDialogFlowResponseBody(name='body'),
}

async function describeDialogFlowWithOptions(request: DescribeDialogFlowRequest, runtime: Util.RuntimeOptions): DescribeDialogFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDialogFlow',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDialogFlow(request: DescribeDialogFlowRequest): DescribeDialogFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDialogFlowWithOptions(request, runtime);
}

model DescribeEntitiesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', example='42212'),
}

model DescribeEntitiesResponseBody = {
  createTime?: string(name='CreateTime', example='2020-12-02T06:35:50Z'),
  createUserId?: string(name='CreateUserId', example='83225'),
  createUserName?: string(name='CreateUserName', example='null'),
  entityId?: long(name='EntityId', example='42212'),
  entityName?: string(name='EntityName'),
  entityType?: string(name='EntityType', example='regex'),
  members?: [ 
    {
      memberName?: string(name='MemberName'),
      synonyms?: [ string ](name='Synonyms'),
    }
  ](name='Members'),
  modifyTime?: string(name='ModifyTime', example='2020-12-02T06:35:50Z'),
  modifyUserId?: string(name='ModifyUserId', example='83225'),
  modifyUserName?: string(name='ModifyUserName', example='null'),
  regex?: string(name='Regex'),
  requestId?: string(name='RequestId', example='3F95508F-8635-4786-A959-E21F6FED4CD1'),
}

model DescribeEntitiesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEntitiesResponseBody(name='body'),
}

async function describeEntitiesWithOptions(request: DescribeEntitiesRequest, runtime: Util.RuntimeOptions): DescribeEntitiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEntities',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeEntities(request: DescribeEntitiesRequest): DescribeEntitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEntitiesWithOptions(request, runtime);
}

model DescribeIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  intentId?: long(name='IntentId', example='126558'),
}

model DescribeIntentResponseBody = {
  createTime?: string(name='CreateTime', example='2020-11-30T03:03:37Z'),
  createUserId?: string(name='CreateUserId', example='83225'),
  createUserName?: string(name='CreateUserName', example='null'),
  dialogId?: long(name='DialogId', example='50099'),
  intentId?: long(name='IntentId', example='126558'),
  modifyTime?: string(name='ModifyTime', example='2020-11-30T06:04:37Z'),
  modifyUserId?: string(name='ModifyUserId', example='83225'),
  modifyUserName?: string(name='ModifyUserName', example='null'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId', example='473F6889-1DE6-44A5-BA62-BD3CC7600DBF'),
  ruleCheck?: [ 
    {
      error?: [ string ](name='Error'),
      strict?: boolean(name='Strict', example='false'),
      text?: string(name='Text'),
      warning?: [ string ](name='Warning'),
    }
  ](name='RuleCheck'),
  slot?: [ 
    {
      isArray?: boolean(name='IsArray', example='false'),
      isNecessary?: boolean(name='IsNecessary', example='true'),
      lifeSpan?: int32(name='LifeSpan', example='0'),
      name?: string(name='Name'),
      question?: [ string ](name='Question'),
      slotId?: string(name='SlotId', example='9ec31b50-32b8-11eb-9478-19d2d885afdb'),
      tags?: [ 
        {
          userSayId?: string(name='UserSayId'),
          value?: string(name='Value'),
        }
      ](name='Tags'),
      value?: string(name='Value'),
    }
  ](name='Slot'),
  type?: string(name='Type'),
  userSay?: [ 
    {
      data?: [ 
        {
          slotId?: string(name='SlotId', example='9ec31b50-32b8-11eb-9478-19d2d885afdb'),
          text?: string(name='Text'),
        }
      ](name='Data'),
      strict?: boolean(name='Strict', example='false'),
      userSayId?: string(name='UserSayId', example='853d7220-32b8-11eb-9478-19d2d885afdb'),
    }
  ](name='UserSay'),
}

model DescribeIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIntentResponseBody(name='body'),
}

async function describeIntentWithOptions(request: DescribeIntentRequest, runtime: Util.RuntimeOptions): DescribeIntentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeIntent',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeIntent(request: DescribeIntentRequest): DescribeIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeIntentWithOptions(request, runtime);
}

model DescribeKnowledgeRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='FAQ ID', example='1002994358'),
}

model DescribeKnowledgeResponseBody = {
  categoryId?: long(name='CategoryId', example='1000053274'),
  coreWords?: [ string ](name='CoreWords'),
  createTime?: string(name='CreateTime', example='2020-11-25T11:44:09Z'),
  createUserName?: string(name='CreateUserName'),
  endDate?: string(name='EndDate', example='2020-11-26T11:56:40Z'),
  keyWords?: [ string ](name='KeyWords'),
  knowledgeId?: long(name='KnowledgeId', description='FAQ ID', example='30001979424'),
  knowledgeStatus?: int32(name='KnowledgeStatus', example='3'),
  knowledgeTitle?: string(name='KnowledgeTitle'),
  knowledgeType?: int32(name='KnowledgeType', example='1'),
  modifyTime?: string(name='ModifyTime', example='2020-11-26T06:36:14Z'),
  modifyUserName?: string(name='ModifyUserName'),
  outlines?: [ 
    {
      knowledgeId?: long(name='KnowledgeId', description='FAQ ID', example='30001979425'),
      outlineId?: long(name='OutlineId', example='30001979424'),
      title?: string(name='Title'),
    }
  ](name='Outlines'),
  requestId?: string(name='RequestId', example='F7F60925-E0ED-50DA-9E0B-ED4B3ECFBA4F'),
  simQuestions?: [ 
    {
      createTime?: string(name='CreateTime', example='2020-11-25T11:44:09Z'),
      modifyTime?: string(name='ModifyTime', example='2020-11-26T06:36:14Z'),
      simQuestionId?: long(name='SimQuestionId', example='30001979424'),
      title?: string(name='Title'),
    }
  ](name='SimQuestions'),
  solutions?: [ 
    {
      content?: string(name='Content'),
      createTime?: string(name='CreateTime', example='2020-11-25T11:44:09Z'),
      modifyTime?: string(name='ModifyTime', example='2020-11-26T06:36:14Z'),
      perspectiveIds?: [ string ](name='PerspectiveIds'),
      plainText?: string(name='PlainText'),
      solutionId?: long(name='SolutionId', example='30001979424'),
      summary?: string(name='Summary'),
    }
  ](name='Solutions'),
  startDate?: string(name='StartDate', example='1979-12-31T16:00:00Z'),
  version?: int32(name='Version', example='1'),
}

model DescribeKnowledgeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeKnowledgeResponseBody(name='body'),
}

async function describeKnowledgeWithOptions(request: DescribeKnowledgeRequest, runtime: Util.RuntimeOptions): DescribeKnowledgeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeKnowledge',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeKnowledge(request: DescribeKnowledgeRequest): DescribeKnowledgeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeKnowledgeWithOptions(request, runtime);
}

model DescribePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  perspectiveId?: string(name='PerspectiveId', example='7487'),
}

model DescribePerspectiveResponseBody = {
  createTime?: string(name='CreateTime', example='2020-11-25T08:26:06Z'),
  createUserName?: string(name='CreateUserName', example='test'),
  modifyTime?: string(name='ModifyTime', example='2020-11-25T08:56:55Z'),
  modifyUserName?: string(name='ModifyUserName', example='test'),
  name?: string(name='Name', example='12'),
  perspectiveCode?: string(name='PerspectiveCode', example='6IReUnbyzb'),
  perspectiveId?: string(name='PerspectiveId', example='7487'),
  requestId?: string(name='RequestId', example='DFB71B34-4188-4EA2-9988-EF3014E75910'),
  selfDefine?: boolean(name='SelfDefine', example='true'),
  status?: int32(name='Status', example='3'),
}

model DescribePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePerspectiveResponseBody(name='body'),
}

async function describePerspectiveWithOptions(request: DescribePerspectiveRequest, runtime: Util.RuntimeOptions): DescribePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.perspectiveId)) {
    query['PerspectiveId'] = request.perspectiveId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePerspective',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePerspective(request: DescribePerspectiveRequest): DescribePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePerspectiveWithOptions(request, runtime);
}

model DisableDialogFlowRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='49966'),
}

model DisableDialogFlowResponseBody = {
  requestId?: string(name='RequestId', example='F0809B63-5DDF-4BB8-AA86-92CE99543922'),
}

model DisableDialogFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableDialogFlowResponseBody(name='body'),
}

async function disableDialogFlowWithOptions(request: DisableDialogFlowRequest, runtime: Util.RuntimeOptions): DisableDialogFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableDialogFlow',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableDialogFlow(request: DisableDialogFlowRequest): DisableDialogFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableDialogFlowWithOptions(request, runtime);
}

model DisableKnowledgeRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='FAQ ID', example='30001979424'),
}

model DisableKnowledgeResponseBody = {
  requestId?: string(name='RequestId', example='54A18EB2-4633-5848-B309-EE551DF62002'),
}

model DisableKnowledgeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableKnowledgeResponseBody(name='body'),
}

async function disableKnowledgeWithOptions(request: DisableKnowledgeRequest, runtime: Util.RuntimeOptions): DisableKnowledgeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableKnowledge',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableKnowledge(request: DisableKnowledgeRequest): DisableKnowledgeResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableKnowledgeWithOptions(request, runtime);
}

model FeedbackRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  feedback?: string(name='Feedback', example='good'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-UfERQYZnra'),
  messageId?: string(name='MessageId', example='8869745c-3b30-44ab-a1ef-20ad4191bfad'),
  sessionId?: string(name='SessionId', example='0054b7d5187d40baba845427f8723'),
}

model FeedbackResponseBody = {
  feedback?: string(name='Feedback', example='good'),
  httpStatus?: long(name='HttpStatus', example='200'),
  messageId?: string(name='MessageId', example='8869745c-3b30-44ab-a1ef-20ad4191bfad'),
  requestId?: string(name='RequestId', example='16D4BC6D-FF53-5EB0-A6A2-CA0F32B6FF7E'),
  success?: boolean(name='Success', example='true'),
}

model FeedbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FeedbackResponseBody(name='body'),
}

async function feedbackWithOptions(request: FeedbackRequest, runtime: Util.RuntimeOptions): FeedbackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.feedback)) {
    query['Feedback'] = request.feedback;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.messageId)) {
    query['MessageId'] = request.messageId;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Feedback',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function feedback(request: FeedbackRequest): FeedbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return feedbackWithOptions(request, runtime);
}

model GetAsyncResultRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  taskId?: string(name='TaskId'),
}

model GetAsyncResultResponseBody = {
  code?: int32(name='Code', example='0'),
  data?: string(name='Data'),
  message?: string(name='Message', example='task execute success'),
  requestId?: string(name='RequestId', example='F79E7305-5314-5069-A701-9591AD051902'),
  success?: boolean(name='Success', example='true'),
}

model GetAsyncResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAsyncResultResponseBody(name='body'),
}

async function getAsyncResultWithOptions(request: GetAsyncResultRequest, runtime: Util.RuntimeOptions): GetAsyncResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAsyncResult',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAsyncResult(request: GetAsyncResultRequest): GetAsyncResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAsyncResultWithOptions(request, runtime);
}

model GetBotChatDataRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model GetBotChatDataResponseBody = {
  costTime?: string(name='CostTime', example='66'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='AD38E52B-B64E-435D-8627-ABB374046CCC'),
}

model GetBotChatDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBotChatDataResponseBody(name='body'),
}

async function getBotChatDataWithOptions(request: GetBotChatDataRequest, runtime: Util.RuntimeOptions): GetBotChatDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBotChatData',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBotChatData(request: GetBotChatDataRequest): GetBotChatDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBotChatDataWithOptions(request, runtime);
}

model GetBotDsStatDataRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model GetBotDsStatDataResponseBody = {
  costTime?: string(name='CostTime', example='70'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='C7EDACCF-0268-4C4F-B529-317F98CA9EF9'),
}

model GetBotDsStatDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBotDsStatDataResponseBody(name='body'),
}

async function getBotDsStatDataWithOptions(request: GetBotDsStatDataRequest, runtime: Util.RuntimeOptions): GetBotDsStatDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBotDsStatData',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBotDsStatData(request: GetBotDsStatDataRequest): GetBotDsStatDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBotDsStatDataWithOptions(request, runtime);
}

model GetBotKnowledgeStatDataRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model GetBotKnowledgeStatDataResponseBody = {
  costTime?: string(name='CostTime', example='77'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='907AA5F2-0521-49AB-80AB-1ADEFAB2B901'),
}

model GetBotKnowledgeStatDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBotKnowledgeStatDataResponseBody(name='body'),
}

async function getBotKnowledgeStatDataWithOptions(request: GetBotKnowledgeStatDataRequest, runtime: Util.RuntimeOptions): GetBotKnowledgeStatDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBotKnowledgeStatData',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBotKnowledgeStatData(request: GetBotKnowledgeStatDataRequest): GetBotKnowledgeStatDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBotKnowledgeStatDataWithOptions(request, runtime);
}

model GetBotSessionDataRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model GetBotSessionDataResponseBody = {
  costTime?: string(name='CostTime', example='116'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='15CD94CC-CBEB-4189-806C-A132D1F45D51'),
}

model GetBotSessionDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBotSessionDataResponseBody(name='body'),
}

async function getBotSessionDataWithOptions(request: GetBotSessionDataRequest, runtime: Util.RuntimeOptions): GetBotSessionDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBotSessionData',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBotSessionData(request: GetBotSessionDataRequest): GetBotSessionDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBotSessionDataWithOptions(request, runtime);
}

model GetConversationListRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endDate?: string(name='EndDate', example='2020-12-01 11:17:38'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqMQe'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  senderId?: string(name='SenderId', example='83325'),
  sessionId?: string(name='SessionId', example='c1187530338311ebade7cf3eaeb3668a'),
  startDate?: string(name='StartDate', example='2020-12-01 11:17:38'),
}

model GetConversationListResponseBody = {
  messages?: [ map[string]string ](name='Messages'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='C83D94BB-D371-4DE9-AEE2-14FE7B9CEBA9'),
  totalCounts?: long(name='TotalCounts', example='1'),
}

model GetConversationListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConversationListResponseBody(name='body'),
}

async function getConversationListWithOptions(request: GetConversationListRequest, runtime: Util.RuntimeOptions): GetConversationListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.senderId)) {
    query['SenderId'] = request.senderId;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConversationList',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getConversationList(request: GetConversationListRequest): GetConversationListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConversationListWithOptions(request, runtime);
}

model ListBotChatHistorysRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  limit?: int32(name='Limit', example='30'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotChatHistorysResponseBody = {
  costTime?: string(name='CostTime', example='146'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='897F3CD0-99CA-4879-BA1D-989C817FDF9E'),
}

model ListBotChatHistorysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotChatHistorysResponseBody(name='body'),
}

async function listBotChatHistorysWithOptions(request: ListBotChatHistorysRequest, runtime: Util.RuntimeOptions): ListBotChatHistorysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotChatHistorys',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotChatHistorys(request: ListBotChatHistorysRequest): ListBotChatHistorysResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotChatHistorysWithOptions(request, runtime);
}

model ListBotColdDsDatasRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  limit?: int32(name='Limit', example='30'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotColdDsDatasResponseBody = {
  costTime?: string(name='CostTime', example='94'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='A270DBA1-694D-447D-9EF9-160EADDB115E'),
}

model ListBotColdDsDatasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotColdDsDatasResponseBody(name='body'),
}

async function listBotColdDsDatasWithOptions(request: ListBotColdDsDatasRequest, runtime: Util.RuntimeOptions): ListBotColdDsDatasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotColdDsDatas',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotColdDsDatas(request: ListBotColdDsDatasRequest): ListBotColdDsDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotColdDsDatasWithOptions(request, runtime);
}

model ListBotColdKnowledgesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  limit?: int32(name='Limit', example='30'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotColdKnowledgesResponseBody = {
  costTime?: string(name='CostTime', example='83'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='1B5B71F0-FE39-466A-BC5E-187A7B6F4632'),
}

model ListBotColdKnowledgesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotColdKnowledgesResponseBody(name='body'),
}

async function listBotColdKnowledgesWithOptions(request: ListBotColdKnowledgesRequest, runtime: Util.RuntimeOptions): ListBotColdKnowledgesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotColdKnowledges',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotColdKnowledges(request: ListBotColdKnowledgesRequest): ListBotColdKnowledgesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotColdKnowledgesWithOptions(request, runtime);
}

model ListBotDsDetailsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  limit?: int32(name='Limit', example='30'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotDsDetailsResponseBody = {
  costTime?: string(name='CostTime', example='72'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='078144CD-7C10-4019-9831-09BC388AAF8C'),
}

model ListBotDsDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotDsDetailsResponseBody(name='body'),
}

async function listBotDsDetailsWithOptions(request: ListBotDsDetailsRequest, runtime: Util.RuntimeOptions): ListBotDsDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotDsDetails',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotDsDetails(request: ListBotDsDetailsRequest): ListBotDsDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotDsDetailsWithOptions(request, runtime);
}

model ListBotHotDsDatasRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  limit?: int32(name='Limit', example='50'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotHotDsDatasResponseBody = {
  costTime?: string(name='CostTime', example='171'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='736994BD-AA35-4742-88C9-E64BE4BAA14B'),
}

model ListBotHotDsDatasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotHotDsDatasResponseBody(name='body'),
}

async function listBotHotDsDatasWithOptions(request: ListBotHotDsDatasRequest, runtime: Util.RuntimeOptions): ListBotHotDsDatasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotHotDsDatas',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotHotDsDatas(request: ListBotHotDsDatasRequest): ListBotHotDsDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotHotDsDatasWithOptions(request, runtime);
}

model ListBotHotKnowledgesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  limit?: int32(name='Limit', example='500'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqM'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotHotKnowledgesResponseBody = {
  costTime?: string(name='CostTime', example='13'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='9394952D-44A6-4AE2-8018-9E3423AAF3B7'),
}

model ListBotHotKnowledgesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotHotKnowledgesResponseBody(name='body'),
}

async function listBotHotKnowledgesWithOptions(request: ListBotHotKnowledgesRequest, runtime: Util.RuntimeOptions): ListBotHotKnowledgesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotHotKnowledges',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotHotKnowledges(request: ListBotHotKnowledgesRequest): ListBotHotKnowledgesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotHotKnowledgesWithOptions(request, runtime);
}

model ListBotKnowledgeDetailsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  limit?: string(name='Limit', example='30'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotKnowledgeDetailsResponseBody = {
  costTime?: string(name='CostTime', example='78'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='1A0F7108-16AF-480C-AF54-45C11A97EAB4'),
}

model ListBotKnowledgeDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotKnowledgeDetailsResponseBody(name='body'),
}

async function listBotKnowledgeDetailsWithOptions(request: ListBotKnowledgeDetailsRequest, runtime: Util.RuntimeOptions): ListBotKnowledgeDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotKnowledgeDetails',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotKnowledgeDetails(request: ListBotKnowledgeDetailsRequest): ListBotKnowledgeDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotKnowledgeDetailsWithOptions(request, runtime);
}

model ListBotReceptionDetailDatasRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', example='20201207'),
  robotInstanceId?: string(name='RobotInstanceId', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', example='20201108'),
}

model ListBotReceptionDetailDatasResponseBody = {
  costTime?: string(name='CostTime', example='77'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='1CCB889E-9837-42C9-BAEC-641169D8DF2A'),
}

model ListBotReceptionDetailDatasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBotReceptionDetailDatasResponseBody(name='body'),
}

async function listBotReceptionDetailDatasWithOptions(request: ListBotReceptionDetailDatasRequest, runtime: Util.RuntimeOptions): ListBotReceptionDetailDatasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBotReceptionDetailDatas',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBotReceptionDetailDatas(request: ListBotReceptionDetailDatasRequest): ListBotReceptionDetailDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBotReceptionDetailDatasWithOptions(request, runtime);
}

model ListConversationLogsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  sessionId?: string(name='SessionId', example='c1187530338311ebade7cf3eaeb3668a'),
}

model ListConversationLogsResponseBody = {
  chatLogs?: [  map[string]any ](name='ChatLogs'),
  requestId?: string(name='RequestId', example='B6082275-D0E3-4030-9478-FFC35BA90312'),
  rounds?: long(name='Rounds', example='1'),
}

model ListConversationLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConversationLogsResponseBody(name='body'),
}

async function listConversationLogsWithOptions(request: ListConversationLogsRequest, runtime: Util.RuntimeOptions): ListConversationLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListConversationLogs',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listConversationLogs(request: ListConversationLogsRequest): ListConversationLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConversationLogsWithOptions(request, runtime);
}

model MoveKnowledgeCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', example='1000053274'),
  knowledgeId?: long(name='KnowledgeId', example='30001979424'),
}

model MoveKnowledgeCategoryResponseBody = {
  requestId?: string(name='RequestId', example='ABC61B71-9F9D-52FD-9E0C-71C4E4B5D097'),
}

model MoveKnowledgeCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MoveKnowledgeCategoryResponseBody(name='body'),
}

async function moveKnowledgeCategoryWithOptions(request: MoveKnowledgeCategoryRequest, runtime: Util.RuntimeOptions): MoveKnowledgeCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MoveKnowledgeCategory',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function moveKnowledgeCategory(request: MoveKnowledgeCategoryRequest): MoveKnowledgeCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return moveKnowledgeCategoryWithOptions(request, runtime);
}

model PublishDialogFlowRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='49966'),
}

model PublishDialogFlowResponseBody = {
  requestId?: string(name='RequestId', example='B58AD5AF-21C8-4DB9-82E8-D445ED579EDC'),
}

model PublishDialogFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PublishDialogFlowResponseBody(name='body'),
}

async function publishDialogFlowWithOptions(request: PublishDialogFlowRequest, runtime: Util.RuntimeOptions): PublishDialogFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PublishDialogFlow',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function publishDialogFlow(request: PublishDialogFlowRequest): PublishDialogFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return publishDialogFlowWithOptions(request, runtime);
}

model PublishKnowledgeRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  async?: boolean(name='Async', example='true'),
  knowledgeId?: long(name='KnowledgeId', example='30001905617'),
}

model PublishKnowledgeResponseBody = {
  requestId?: string(name='RequestId', example='74D1B5C6-BACE-5F5A-9A24-898F74696627'),
}

model PublishKnowledgeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PublishKnowledgeResponseBody(name='body'),
}

async function publishKnowledgeWithOptions(request: PublishKnowledgeRequest, runtime: Util.RuntimeOptions): PublishKnowledgeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.async)) {
    query['Async'] = request.async;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PublishKnowledge',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function publishKnowledge(request: PublishKnowledgeRequest): PublishKnowledgeResponse {
  var runtime = new Util.RuntimeOptions{};
  return publishKnowledgeWithOptions(request, runtime);
}

model QueryBotsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryBotsResponseBody = {
  bots?: [ 
    {
      avatar?: string(name='Avatar', example='C:\\\\Users\\\\ypfyu\\\\Pictures'),
      createTime?: string(name='CreateTime', example='2020-11-29T06:50:46Z'),
      instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqMQe'),
      introduction?: string(name='Introduction'),
      languageCode?: string(name='LanguageCode', example='zh-cn'),
      name?: string(name='Name', example='test'),
      timeZone?: string(name='TimeZone', example='Asia/Beijing'),
    }
  ](name='Bots'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='6FAC33F5-F76A-476C-9FEF-5838F869BD4B'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model QueryBotsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryBotsResponseBody(name='body'),
}

async function queryBotsWithOptions(request: QueryBotsRequest, runtime: Util.RuntimeOptions): QueryBotsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryBots',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryBots(request: QueryBotsRequest): QueryBotsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBotsWithOptions(request, runtime);
}

model QueryCategoriesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeType?: long(name='KnowledgeType', example='1'),
  parentCategoryId?: long(name='ParentCategoryId', example='-1'),
  showChildrens?: boolean(name='ShowChildrens', example='true'),
}

model QueryCategoriesResponseBody = {
  categories?: [
    Children
  ](name='Categories'),
  requestId?: string(name='RequestId', example='17204B98-7734-4F9A-8464-2446A84821CA'),
}

model QueryCategoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCategoriesResponseBody(name='body'),
}

async function queryCategoriesWithOptions(request: QueryCategoriesRequest, runtime: Util.RuntimeOptions): QueryCategoriesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.knowledgeType)) {
    query['KnowledgeType'] = request.knowledgeType;
  }
  if (!Util.isUnset(request.parentCategoryId)) {
    query['ParentCategoryId'] = request.parentCategoryId;
  }
  if (!Util.isUnset(request.showChildrens)) {
    query['ShowChildrens'] = request.showChildrens;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCategories',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryCategories(request: QueryCategoriesRequest): QueryCategoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCategoriesWithOptions(request, runtime);
}

model QueryCoreWordsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  coreWordName?: string(name='CoreWordName'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  synonym?: string(name='Synonym'),
}

model QueryCoreWordsResponseBody = {
  coreWords?: [ 
    {
      coreWordCode?: string(name='CoreWordCode', example='405d73a6-ac3c-37fd-96a6-94ae2a882c1e'),
      coreWordName?: string(name='CoreWordName'),
      createTime?: string(name='CreateTime', example='2020-11-24T03:49:18Z'),
      modifyTime?: string(name='ModifyTime', example='2020-11-25T10:31:10Z'),
      synonyms?: [ string ](name='Synonyms'),
    }
  ](name='CoreWords'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='92B81548-42B9-4B34-924B-4E778AEB412B'),
  totalCount?: int32(name='TotalCount', example='3'),
}

model QueryCoreWordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCoreWordsResponseBody(name='body'),
}

async function queryCoreWordsWithOptions(request: QueryCoreWordsRequest, runtime: Util.RuntimeOptions): QueryCoreWordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.synonym)) {
    query['Synonym'] = request.synonym;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCoreWords',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryCoreWords(request: QueryCoreWordsRequest): QueryCoreWordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCoreWordsWithOptions(request, runtime);
}

model QueryDialogsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogName?: string(name='DialogName'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-7QuUfaqMQe'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryDialogsResponseBody = {
  dialogs?: [ 
    {
      createTime?: string(name='CreateTime', example='2020-11-30T03:00:54Z'),
      createUserId?: string(name='CreateUserId', example='83225'),
      createUserName?: string(name='CreateUserName', example='null'),
      description?: string(name='Description'),
      dialogId?: long(name='DialogId', example='50099'),
      dialogName?: string(name='DialogName'),
      isOnline?: boolean(name='IsOnline', example='true'),
      isSampleDialog?: boolean(name='IsSampleDialog', example='false'),
      modifyTime?: string(name='ModifyTime', example='2020-11-30T06:12:47Z'),
      modifyUserId?: string(name='ModifyUserId', example='83225'),
      modifyUserName?: string(name='ModifyUserName', example='null'),
      status?: int32(name='Status', example='3'),
    }
  ](name='Dialogs'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='7F132693-212A-40A9-8A81-11E7694E478B'),
  totalCount?: int32(name='TotalCount', example='3'),
}

model QueryDialogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDialogsResponseBody(name='body'),
}

/**
  * ****
  *
  * @param request QueryDialogsRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return QueryDialogsResponse
 */
async function queryDialogsWithOptions(request: QueryDialogsRequest, runtime: Util.RuntimeOptions): QueryDialogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogName)) {
    query['DialogName'] = request.dialogName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDialogs',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * ****
  *
  * @param request QueryDialogsRequest
  * @return QueryDialogsResponse
 */
async function queryDialogs(request: QueryDialogsRequest): QueryDialogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDialogsWithOptions(request, runtime);
}

model QueryEntitiesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='50405'),
  entityName?: string(name='EntityName'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryEntitiesResponseBody = {
  entities?: [ 
    {
      createTime?: string(name='CreateTime', example='2020-12-02T06:35:50Z'),
      createUserId?: string(name='CreateUserId', example='83225'),
      createUserName?: string(name='CreateUserName', example='null'),
      entityId?: long(name='EntityId', example='42212'),
      entityName?: string(name='EntityName'),
      entityType?: string(name='EntityType', example='regex'),
      members?: [ 
        {
          memberName?: string(name='MemberName'),
          synonyms?: [ string ](name='Synonyms'),
        }
      ](name='Members'),
      modifyTime?: string(name='ModifyTime', example='2020-12-02T06:35:50Z'),
      modifyUserId?: string(name='ModifyUserId', example='83225'),
      modifyUserName?: string(name='ModifyUserName', example='null'),
      regex?: string(name='Regex'),
    }
  ](name='Entities'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='206FCA00-9802-492E-86B3-5BCABDB6EF71'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model QueryEntitiesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryEntitiesResponseBody(name='body'),
}

async function queryEntitiesWithOptions(request: QueryEntitiesRequest, runtime: Util.RuntimeOptions): QueryEntitiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  if (!Util.isUnset(request.entityName)) {
    query['EntityName'] = request.entityName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEntities',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEntities(request: QueryEntitiesRequest): QueryEntitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEntitiesWithOptions(request, runtime);
}

model QueryIntentsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='50099'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-v0h17ngxu00016'),
  intentName?: string(name='IntentName'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryIntentsResponseBody = {
  intents?: [ 
    {
      createTime?: string(name='CreateTime', example='2020-11-30T03:03:37Z'),
      createUserId?: string(name='CreateUserId', example='83225'),
      createUserName?: string(name='CreateUserName', example='null'),
      intentId?: long(name='IntentId', example='126558'),
      modifyTime?: string(name='ModifyTime', example='2020-11-30T03:03:37Z'),
      modifyUserId?: string(name='ModifyUserId', example='83325'),
      modifyUserName?: string(name='ModifyUserName', example='null'),
      name?: string(name='Name'),
      ruleCheck?: [ 
        {
          error?: [ string ](name='Error'),
          strict?: boolean(name='Strict', example='false'),
          text?: string(name='Text'),
          warning?: [ string ](name='Warning'),
        }
      ](name='RuleCheck'),
      slot?: [ 
        {
          isArray?: boolean(name='IsArray', example='false'),
          isNecessary?: boolean(name='IsNecessary', example='true'),
          lifeSpan?: int32(name='LifeSpan', example='0'),
          name?: string(name='Name'),
          question?: [ string ](name='Question'),
          slotId?: string(name='SlotId', example='9ec31b50-32b8-11eb-9478-19d2d885afdb'),
          tags?: [ 
            {
              userSayId?: string(name='UserSayId'),
              value?: string(name='Value'),
            }
          ](name='Tags'),
          value?: string(name='Value'),
        }
      ](name='Slot'),
      userSay?: [ 
        {
          data?: [ 
            {
              slotId?: string(name='SlotId', example='9ec31b50-32b8-11eb-9478-19d2d885afdb'),
              text?: string(name='Text'),
            }
          ](name='Data'),
          strict?: boolean(name='Strict', example='false'),
          userSayId?: string(name='UserSayId', example='853d7220-32b8-11eb-9478-19d2d885afdb'),
        }
      ](name='UserSay'),
    }
  ](name='Intents'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='A1C54450-F19B-4883-90E3-FDB686BF0381'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model QueryIntentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryIntentsResponseBody(name='body'),
}

async function queryIntentsWithOptions(request: QueryIntentsRequest, runtime: Util.RuntimeOptions): QueryIntentsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentName)) {
    query['IntentName'] = request.intentName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryIntents',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryIntents(request: QueryIntentsRequest): QueryIntentsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryIntentsWithOptions(request, runtime);
}

model QueryKnowledgesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', example='1000053274'),
  coreWordName?: string(name='CoreWordName'),
  knowledgeTitle?: string(name='KnowledgeTitle'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryKnowledgesResponseBody = {
  knowledges?: [ 
    {
      categoryId?: long(name='CategoryId', example='1000053274'),
      coreWords?: [ string ](name='CoreWords'),
      createTime?: string(name='CreateTime', example='2020-11-25T11:44:09Z'),
      createUserName?: string(name='CreateUserName'),
      endDate?: string(name='EndDate', example='2020-11-26T11:56:40Z'),
      knowledgeId?: long(name='KnowledgeId', description='FAQ ID', example='30001979424'),
      knowledgeStatus?: int32(name='KnowledgeStatus', example='3'),
      knowledgeTitle?: string(name='KnowledgeTitle'),
      modifyTime?: string(name='ModifyTime', example='2022-01-24T06:02:37Z'),
      modifyUserName?: string(name='ModifyUserName'),
      startDate?: string(name='StartDate', example='2020-11-25T11:56:23Z'),
      version?: string(name='Version', example='2'),
    }
  ](name='Knowledges'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='D2605A09-827E-5C50-87A5-547498B93E8F'),
  totalCount?: int32(name='TotalCount', example='84'),
}

model QueryKnowledgesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryKnowledgesResponseBody(name='body'),
}

async function queryKnowledgesWithOptions(request: QueryKnowledgesRequest, runtime: Util.RuntimeOptions): QueryKnowledgesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  if (!Util.isUnset(request.knowledgeTitle)) {
    query['KnowledgeTitle'] = request.knowledgeTitle;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryKnowledges',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryKnowledges(request: QueryKnowledgesRequest): QueryKnowledgesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryKnowledgesWithOptions(request, runtime);
}

model QueryPerspectivesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
}

model QueryPerspectivesResponseBody = {
  perspectives?: [ 
    {
      createTime?: string(name='CreateTime', example='2020-11-12T04:17:31Z'),
      createUserName?: string(name='CreateUserName', example='test'),
      modifyTime?: string(name='ModifyTime', example='2020-11-12T04:17:31Z'),
      modifyUserName?: string(name='ModifyUserName', example='test'),
      name?: string(name='Name'),
      perspectiveCode?: string(name='PerspectiveCode', example='default'),
      perspectiveId?: string(name='PerspectiveId', example='1001'),
      selfDefine?: boolean(name='SelfDefine', example='false'),
      status?: int32(name='Status', example='3'),
    }
  ](name='Perspectives'),
  requestId?: string(name='RequestId', example='DBBF6308-C267-45EE-A0DF-14E401E25272'),
}

model QueryPerspectivesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPerspectivesResponseBody(name='body'),
}

async function queryPerspectivesWithOptions(request: QueryPerspectivesRequest, runtime: Util.RuntimeOptions): QueryPerspectivesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPerspectives',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryPerspectives(request: QueryPerspectivesRequest): QueryPerspectivesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPerspectivesWithOptions(request, runtime);
}

model QuerySystemEntitiesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityName?: string(name='EntityName'),
}

model QuerySystemEntitiesResponseBody = {
  requestId?: string(name='RequestId', example='F6E5D7FE-6165-4478-BC52-9E0D1DAD5C84'),
  systemEntities?: [ 
    {
      defaultQuestion?: string(name='DefaultQuestion'),
      entityCode?: string(name='EntityCode', example='@sys.geo-city'),
      entityName?: string(name='EntityName'),
    }
  ](name='SystemEntities'),
}

model QuerySystemEntitiesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySystemEntitiesResponseBody(name='body'),
}

async function querySystemEntitiesWithOptions(request: QuerySystemEntitiesRequest, runtime: Util.RuntimeOptions): QuerySystemEntitiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityName)) {
    query['EntityName'] = request.entityName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySystemEntities',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function querySystemEntities(request: QuerySystemEntitiesRequest): QuerySystemEntitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySystemEntitiesWithOptions(request, runtime);
}

model RemoveEntityMemberRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', example='13853'),
  member?: {
    memberName?: string(name='MemberName'),
    synonyms?: [ string ](name='Synonyms'),
  }(name='Member'),
  removeType?: string(name='RemoveType', example='memberName'),
}

model RemoveEntityMemberShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', example='13853'),
  memberShrink?: string(name='Member'),
  removeType?: string(name='RemoveType', example='memberName'),
}

model RemoveEntityMemberResponseBody = {
  entityId?: long(name='EntityId', example='13853'),
  requestId?: string(name='RequestId', example='E42C928F-202A-4896-8F4A-DA718720BC98'),
}

model RemoveEntityMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveEntityMemberResponseBody(name='body'),
}

async function removeEntityMemberWithOptions(tmpReq: RemoveEntityMemberRequest, runtime: Util.RuntimeOptions): RemoveEntityMemberResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveEntityMemberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.member)) {
    request.memberShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.member, 'Member', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.memberShrink)) {
    query['Member'] = request.memberShrink;
  }
  if (!Util.isUnset(request.removeType)) {
    query['RemoveType'] = request.removeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveEntityMember',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeEntityMember(request: RemoveEntityMemberRequest): RemoveEntityMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeEntityMemberWithOptions(request, runtime);
}

model RemoveSynonymRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  coreWordName?: string(name='CoreWordName'),
  synonym?: string(name='Synonym'),
}

model RemoveSynonymResponseBody = {
  requestId?: string(name='RequestId', example='C191B48B-9268-4FB1-A3C2-5143B4A91D0C'),
}

model RemoveSynonymResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveSynonymResponseBody(name='body'),
}

async function removeSynonymWithOptions(request: RemoveSynonymRequest, runtime: Util.RuntimeOptions): RemoveSynonymResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  if (!Util.isUnset(request.synonym)) {
    query['Synonym'] = request.synonym;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveSynonym',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeSynonym(request: RemoveSynonymRequest): RemoveSynonymResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeSynonymWithOptions(request, runtime);
}

model TestDialogFlowRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='1111'),
}

model TestDialogFlowResponseBody = {
  requestId?: string(name='RequestId', example='1891FFA2-8F35-4F9A-BF16-D4A6E1F58EC0'),
}

model TestDialogFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TestDialogFlowResponseBody(name='body'),
}

async function testDialogFlowWithOptions(request: TestDialogFlowRequest, runtime: Util.RuntimeOptions): TestDialogFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TestDialogFlow',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function testDialogFlow(request: TestDialogFlowRequest): TestDialogFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return testDialogFlowWithOptions(request, runtime);
}

model UpdateCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', example='2100073759'),
  name?: string(name='Name'),
}

model UpdateCategoryResponseBody = {
  requestId?: string(name='RequestId', example='F79E7305-5314-5069-A701-9591AD051902'),
  success?: boolean(name='Success', example='true'),
}

model UpdateCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCategoryResponseBody(name='body'),
}

async function updateCategoryWithOptions(request: UpdateCategoryRequest, runtime: Util.RuntimeOptions): UpdateCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCategory',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateCategory(request: UpdateCategoryRequest): UpdateCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCategoryWithOptions(request, runtime);
}

model UpdateCoreWordRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  coreWordCode?: string(name='CoreWordCode', example='ceb9d68c-dbb5-32c9-a02c-eca56b782ff7'),
  coreWordName?: string(name='CoreWordName'),
}

model UpdateCoreWordResponseBody = {
  requestId?: string(name='RequestId', example='D0DDFC4C-D66D-4787-9AE4-4D757481EDEE'),
  success?: boolean(name='Success', example='true'),
}

model UpdateCoreWordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCoreWordResponseBody(name='body'),
}

async function updateCoreWordWithOptions(request: UpdateCoreWordRequest, runtime: Util.RuntimeOptions): UpdateCoreWordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.coreWordCode)) {
    query['CoreWordCode'] = request.coreWordCode;
  }
  if (!Util.isUnset(request.coreWordName)) {
    query['CoreWordName'] = request.coreWordName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCoreWord',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateCoreWord(request: UpdateCoreWordRequest): UpdateCoreWordResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCoreWordWithOptions(request, runtime);
}

model UpdateDialogRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  description?: string(name='Description'),
  dialogId?: long(name='DialogId', example='50120'),
  dialogName?: string(name='DialogName'),
}

model UpdateDialogResponseBody = {
  requestId?: string(name='RequestId', example='FF157949-D464-4563-99C0-AC1C889729B6'),
}

model UpdateDialogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDialogResponseBody(name='body'),
}

async function updateDialogWithOptions(request: UpdateDialogRequest, runtime: Util.RuntimeOptions): UpdateDialogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  if (!Util.isUnset(request.dialogName)) {
    query['DialogName'] = request.dialogName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDialog',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDialog(request: UpdateDialogRequest): UpdateDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDialogWithOptions(request, runtime);
}

model UpdateDialogFlowRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='93130'),
  moduleDefinition?: {
    globalVars?: map[string]any(name='GlobalVars', example='{"name":"", "uid":""}'),
    moduleDefinition?: PaasProcessData(name='ModuleDefinition'),
  }(name='ModuleDefinition'),
}

model UpdateDialogFlowShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  dialogId?: long(name='DialogId', example='93130'),
  moduleDefinitionShrink?: string(name='ModuleDefinition'),
}

model UpdateDialogFlowResponseBody = {
  requestId?: string(name='RequestId', example='F561E093-43D8-563E-8B96-34CC654BA2CB'),
}

model UpdateDialogFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDialogFlowResponseBody(name='body'),
}

async function updateDialogFlowWithOptions(tmpReq: UpdateDialogFlowRequest, runtime: Util.RuntimeOptions): UpdateDialogFlowResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateDialogFlowShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.moduleDefinition)) {
    request.moduleDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.moduleDefinition, 'ModuleDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.moduleDefinitionShrink)) {
    body['ModuleDefinition'] = request.moduleDefinitionShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDialogFlow',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDialogFlow(request: UpdateDialogFlowRequest): UpdateDialogFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDialogFlowWithOptions(request, runtime);
}

model UpdateEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', example='13866'),
  entityName?: string(name='EntityName'),
  entityType?: string(name='EntityType', example='synonyms'),
  members?: [ 
    {
      memberName?: string(name='MemberName'),
      synonyms?: [ string ](name='Synonyms'),
    }
  ](name='Members'),
  regex?: string(name='Regex', example='(\\\\d+-\\\\d+-\\\\d+\\\\s\\\\S+)\\\\s\\\\[(\\\\S+)\\\\s([^:]+):(\\\\d+)\\\\s(\\\\w+)]\\\\s\\\\[(\\\\d+)\\\\s(\\\\d+)]\\\\s\\\\[([^]]+)]\\\\s(\\\\w+)\\\\s(.*)'),
}

model UpdateEntityShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', example='13866'),
  entityName?: string(name='EntityName'),
  entityType?: string(name='EntityType', example='synonyms'),
  membersShrink?: string(name='Members'),
  regex?: string(name='Regex', example='(\\\\d+-\\\\d+-\\\\d+\\\\s\\\\S+)\\\\s\\\\[(\\\\S+)\\\\s([^:]+):(\\\\d+)\\\\s(\\\\w+)]\\\\s\\\\[(\\\\d+)\\\\s(\\\\d+)]\\\\s\\\\[([^]]+)]\\\\s(\\\\w+)\\\\s(.*)'),
}

model UpdateEntityResponseBody = {
  entityId?: long(name='EntityId', example='63405'),
  requestId?: string(name='RequestId', example='4B3E0DE3-DC57-5BFE-88D4-ADD8ED024F55'),
}

model UpdateEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEntityResponseBody(name='body'),
}

async function updateEntityWithOptions(tmpReq: UpdateEntityRequest, runtime: Util.RuntimeOptions): UpdateEntityResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateEntityShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.members)) {
    request.membersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.members, 'Members', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.entityName)) {
    query['EntityName'] = request.entityName;
  }
  if (!Util.isUnset(request.entityType)) {
    query['EntityType'] = request.entityType;
  }
  if (!Util.isUnset(request.regex)) {
    query['Regex'] = request.regex;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.membersShrink)) {
    body['Members'] = request.membersShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEntity',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateEntity(request: UpdateEntityRequest): UpdateEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateEntityWithOptions(request, runtime);
}

model UpdateIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  intentDefinition?: IntentCreateDTO(name='IntentDefinition'),
  intentId?: long(name='IntentId', example='59055'),
}

model UpdateIntentShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  intentDefinitionShrink?: string(name='IntentDefinition'),
  intentId?: long(name='IntentId', example='59055'),
}

model UpdateIntentResponseBody = {
  intentId?: long(name='IntentId', example='59055'),
  requestId?: string(name='RequestId', example='D641EA5C-0638-53A2-A1E4-67A9B5C92100'),
}

model UpdateIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIntentResponseBody(name='body'),
}

async function updateIntentWithOptions(tmpReq: UpdateIntentRequest, runtime: Util.RuntimeOptions): UpdateIntentResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateIntentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.intentDefinition)) {
    request.intentDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.intentDefinition, 'IntentDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.intentDefinitionShrink)) {
    query['IntentDefinition'] = request.intentDefinitionShrink;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIntent',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateIntent(request: UpdateIntentRequest): UpdateIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIntentWithOptions(request, runtime);
}

model UpdateKnowledgeRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledge?: {
    categoryId?: long(name='CategoryId', example='30000049006'),
    endDate?: string(name='EndDate', example='2099-12-31T16:00:00Z'),
    knowledgeId?: long(name='KnowledgeId', description='FAQ ID', example='30001905617'),
    knowledgeTitle?: string(name='KnowledgeTitle'),
    knowledgeType?: int32(name='KnowledgeType', example='1'),
    outlines?: [ 
      {
        action?: string(name='Action', example='ADD'),
        knowledgeId?: long(name='KnowledgeId', example='30001905617'),
        outlineId?: long(name='OutlineId', example='30001979424'),
        title?: string(name='Title'),
      }
    ](name='Outlines'),
    simQuestions?: [ 
      {
        action?: string(name='Action', example='ADD'),
        simQuestionId?: long(name='SimQuestionId', example='30003759180'),
        title?: string(name='Title'),
      }
    ](name='SimQuestions'),
    solutions?: [ 
      {
        action?: string(name='Action', example='ADD'),
        content?: string(name='Content'),
        perspectiveIds?: [ string ](name='PerspectiveIds'),
        plainText?: string(name='PlainText'),
        solutionId?: long(name='SolutionId', example='30001905617'),
      }
    ](name='Solutions'),
    startDate?: string(name='StartDate', example='1979-12-31T16:00:00Z'),
  }(name='Knowledge'),
}

model UpdateKnowledgeShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeShrink?: string(name='Knowledge'),
}

model UpdateKnowledgeResponseBody = {
  knowledgeId?: long(name='KnowledgeId', example='30001905617'),
  requestId?: string(name='RequestId', example='27C1B103-7A35-532B-8886-B5A91C86CFA4'),
}

model UpdateKnowledgeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateKnowledgeResponseBody(name='body'),
}

async function updateKnowledgeWithOptions(tmpReq: UpdateKnowledgeRequest, runtime: Util.RuntimeOptions): UpdateKnowledgeResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateKnowledgeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.knowledge)) {
    request.knowledgeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.knowledge, 'Knowledge', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeShrink)) {
    body['Knowledge'] = request.knowledgeShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateKnowledge',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateKnowledge(request: UpdateKnowledgeRequest): UpdateKnowledgeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateKnowledgeWithOptions(request, runtime);
}

model UpdatePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  name?: string(name='Name'),
  perspectiveId?: string(name='PerspectiveId', example='7488'),
}

model UpdatePerspectiveResponseBody = {
  requestId?: string(name='RequestId', example='A8CA5217-4B7A-40F9-8985-416C2DCD5D4A'),
}

model UpdatePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePerspectiveResponseBody(name='body'),
}

async function updatePerspectiveWithOptions(request: UpdatePerspectiveRequest, runtime: Util.RuntimeOptions): UpdatePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.perspectiveId)) {
    query['PerspectiveId'] = request.perspectiveId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePerspective',
    version = '2017-10-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updatePerspective(request: UpdatePerspectiveRequest): UpdatePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePerspectiveWithOptions(request, runtime);
}

